//
//  BIDReceivedNoticeCell.m
//  cxgov
//
//  Created by mal on 16/3/6.
//  Copyright © 2016年 mal. All rights reserved.
//

#import "BIDReceivedLeaveCell.h"
#import "BIDGlobalMethods.h"

@implementation BIDReceivedLeaveCell
@synthesize titleLabel;
@synthesize dateLabel;
@synthesize nameLabel;
@synthesize readFlagLabel;
@synthesize widthForReadFlagConstraint;
@synthesize leadingForTitleLabelConstraint;

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)setReadFlag:(NSInteger)readFlag
{
    NSString *strFlag = @"";
    UIColor *blueColor = RGBACOLOR(34.f, 126.f, 250.f, 1.f);
    UIColor *redColor = [UIColor redColor];
    UIColor *color = nil;
    switch(readFlag)
    {
        case 1:
        {
            strFlag = @"[未审核]";
            color = redColor;
        }
            break;
        case 2:
        {
            strFlag = @"[同意]";
            color = blueColor;
        }
            break;
        case 3:
        {
            strFlag = @"[不同意]";
            color = blueColor;
        }
            break;
    }
    CGFloat width = [BIDGlobalMethods getWidthWithString:strFlag font:readFlagLabel.font constraintSize:CGSizeMake(MAXFLOAT, CGRectGetHeight(readFlagLabel.frame))];
    readFlagLabel.textColor = color;
    readFlagLabel.text = strFlag;

    leadingForTitleLabelConstraint.constant = 8;
    widthForReadFlagConstraint.constant = width;
    [self layoutIfNeeded];
}

@end
